package com.hh.test.io;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class FileBufferOp {

	public static void main(String[] args) {
		long st = System.currentTimeMillis();

		String fileOut = "C:\\workspace\\w0\\test\\src\\test\\java\\com\\hh\\test\\io\\fileOut.txt";
		String in = "C:\\workspace\\w0\\test\\src\\test\\java\\com\\hh\\test\\io\\txt.txt";
		try {
			BufferedInputStream input = new BufferedInputStream(new FileInputStream(in));
			FileOutputStream out = new FileOutputStream(fileOut);
			byte[] buffer = new byte[1024 * 10];
			int length = -1;
			while ((length = input.read(buffer)) != -1) {
				out.write(buffer, 0, length);
			}
			out.flush();
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println(System.currentTimeMillis() - st);

	}
}
